import sys
sys.path.append('..')

from models import db, DepartmentOrg

org_pair = [
(1,4),
(4,7),
(7,10),
(10,9),
(10,107),
(10,50),
(50,63),
(50,64),
(50,65),
(50,66),
(50,67),
(50,111),
(50,51),
(51,52),
(51,53),
(51,54),
(51,55),
(51,56),
(51,57),
(51,58),
(51,59),
(51,60),
(51,61),
(51,62),
(10,38),
(38,35),
(38,36),
(38,37),
(38,39),
(38,41),
(38,113),
(38,114),
(38,13),
(13,11),
(13,12),
(13,14),
(13,15),
(13,16),
(13,17),
(13,18),
(13,109),
(38,27),
(27,21),
(27,22),
(27,23),
(27,24),
(27,25),
(27,26),
(27,110),
(38,34),
(34,28),
(34,29),
(34,31),
(34,32),
(34,33),
(38,42),
(42,43),
(42,44),
(42,45),
(42,46),
(42,47),
(42,48),
(42,49),
(10,92),
(92,93),
(92,94),
(92,95),
(92,96),
(92,97),
(92,98),
(92,99),
(92,100),
(92,103),
(92,104),
(92,2),
(2,101),
(2,102),
(2,105),
(2,106),
(2,112),
(92,91),
(91,78),
(91,79),
(91,80),
(91,81),
(91,82),
(91,83),
(91,84),
(91,85),
(91,86),
(91,87),
(91,88),
(91,89),
(91,90),
(91,115),
(92,73),
(73,69),
(73,70),
(73,71),
(73,72),
(73,74),
(73,75),
(73,76),
(73,77),
(73,108),

]

org_pair = [
    (38,117),(50,116),(92,118)


]

for p,c in org_pair:

    db.session.add(DepartmentOrg(parent_id=p,child_id=c))
    db.session.commit()
    print(f'Add {p} {c} Successfully!')


